package org.wms.minbearwcs.controller.Inbound;

import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import org.wms.minbearwcs.entity.DTO.inbound.order.InboundOrderReceive;
import org.wms.minbearwcs.entity.DTO.response.RespOrderCode;
import org.wms.minbearwcs.serivce.inbound.InboundService;

@RestController
@RequiredArgsConstructor
public class InboundController {

    private final InboundService inboundService;

    @PostMapping("/inbound/dispatch")
    public RespOrderCode InboundOrderReceive(@RequestBody InboundOrderReceive receive) {
        inboundService.receiveInboundOrder(receive);
        return RespOrderCode.build()
                .setAssociatedOrderCode(receive.getInboundOrderCode());
    }


}
